﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:NYTimes="clr-namespace:NYTimes;assembly=NYTimesSilverlightKit" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	xmlns:nytvc="clr-namespace:NYTimes.ValueConverters;assembly=NYTimesSilverlightKit" xmlns:Custom="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:NYTMovieReviews="clr-namespace:NYTMovieReviews" mc:Ignorable="d">
	<!-- Resource dictionary entries should be defined here. -->
	<nytvc:VisibleIfTrueConverter x:Key="VisibleIfTrueConverter"/>
	<DataTemplate x:Key="MovieReviewTemplate">
		<Grid d:DesignWidth="456">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="Auto"/>
				<ColumnDefinition/>
			</Grid.ColumnDefinitions>
			<Image Source="{Binding Thumbnail}" Height="75" Width="75" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,12,0,0"/>
			<StackPanel Grid.Column="1">
				<TextBlock x:Name="Title" Text="{Binding DisplayTitle}" TextWrapping="Wrap" Style="{StaticResource PhoneTextLargeStyle}"/>
				<Grid>
					<Grid.ColumnDefinitions>
						<ColumnDefinition/>
						<ColumnDefinition Width="Auto"/>
					</Grid.ColumnDefinitions>
				<TextBlock x:Name="Headline" Text="{Binding Headline}" Style="{StaticResource PhoneTextSmallStyle}"  d:LayoutOverrides="Height" TextWrapping="Wrap"/>
				<TextBlock x:Name="CriticsPick" Margin="0" TextWrapping="Wrap" Text="Critics' Pick" VerticalAlignment="Top" Style="{StaticResource PhoneTextAccentStyle}" HorizontalAlignment="Left" Visibility="{Binding CriticsPick, Converter={StaticResource VisibleIfTrueConverter}}" Grid.Column="1"/>
				</Grid>
			</StackPanel>
		</Grid>
	</DataTemplate>
	<DataTemplate x:Key="PivotItemTemplate">
		<Grid d:DesignHeight="800" d:DesignWidth="480">
			<Grid.RowDefinitions>
				<RowDefinition Height="Auto"/>
				<RowDefinition/>
			</Grid.RowDefinitions>
			<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
				<TextBlock TextWrapping="Wrap" Text="{Binding Reviews.TotalResults, ConverterParameter=n0, Converter={StaticResource NumericFormatConverter}, Mode=OneWay}" d:LayoutOverrides="Width" Style="{StaticResource PhoneTextSmallStyle}" Margin="12,0,0,0">
					<TextBlock.Foreground>
						<SolidColorBrush Color="{StaticResource PhoneAccentColor}"/>
					</TextBlock.Foreground>
				</TextBlock>
				<TextBlock TextWrapping="Wrap" Text=" results" Style="{StaticResource PhoneTextSmallStyle}" Margin="0,0,12,0">
					<TextBlock.Foreground>
						<SolidColorBrush Color="{StaticResource PhoneAccentColor}"/>
					</TextBlock.Foreground>
				</TextBlock>
			</StackPanel>
			<ListBox ItemsSource="{Binding Reviews.Results}" ItemTemplate="{StaticResource MovieReviewTemplate}" Grid.Row="1">
				<Custom:Interaction.Behaviors>
					<NYTMovieReviews:DetailNavigateBehavior/>
				</Custom:Interaction.Behaviors>
			</ListBox>
		</Grid>
	</DataTemplate>
	<DataTemplate x:Key="PivotHeaderTemplate">
		<TextBlock Text="{Binding DisplayName}"/>
	</DataTemplate>
	<nytvc:NumericFormatConverter x:Key="NumericFormatConverter" />
</ResourceDictionary>